{% extends "base.html" %}

{% block content %}
<div class="error-page">
    <div class="error-container">
        <div class="error-code">{{ error_code or "404" }}</div>
        <div class="error-message">{{ error_message or "页面未找到" }}</div>
        <div class="error-description">
            {% if error_code == "404" %}
                抱歉，您访问的页面不存在或已被删除。
            {% elif error_code == "500" %}
                服务器内部错误，请稍后再试。
            {% elif error_code == "403" %}
                您没有权限访问此页面。
            {% else %}
                发生了一个未知错误。
            {% endif %}
        </div>
        <div class="error-actions">
            <a href="{{ url_for('main.index') }}" class="btn btn-primary">返回首页</a>
            <a href="javascript:history.back()" class="btn btn-secondary">返回上页</a>
        </div>
    </div>
</div>

<style>
.error-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.error-container {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.error-code {
    font-size: 6rem;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 1rem;
    line-height: 1;
}

.error-message {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 500;
}

.error-description {
    color: #7f8c8d;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .error-code {
        font-size: 4rem;
    }
    
    .error-message {
        font-size: 1.25rem;
    }
    
    .error-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 200px;
    }
}
</style>
{% endblock %}